// 使用es6的语法导入js模块
import Vue from '../node_modules/vue/dist/vue'
import VueRouter from '../node_modules/vue-router/dist/vue-router'
import loginForm from './js/login'
import registerForm from './js/register'

Vue.use(VueRouter);

// 创建VueRouter对象
const router = new VueRouter({
    routes:[ // 编写多个路由规则 请求路径 组件名称
        {path:"/login", component:loginForm},
        {path:"/register",component:registerForm},
    ]
})

var vm = new Vue({
    el:"#app",
    components:{// 引用登录和注册组件
        loginForm,
        registerForm
    },
    router
})

// 直接运行不了，浏览器不认识，必需借助webpack
